package com.code.leetcode.before50;

import com.code.leetcode.utils.TreeNode;
import sun.reflect.generics.tree.Tree;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Stack;

/**
 * @author codeDorado
 * @version 1.0
 * @date 2020/7/25 16:27
 */
public class The101 {


    public boolean isSymmetric(TreeNode root) {
       return  check(root, root);
    }

    public boolean check(TreeNode nodel, TreeNode noder) {
        if (nodel == null && noder == null) {
            return true;
        }
        if (nodel == null || noder == null) {
            return false;
        }
        return nodel.val == noder.val && check(nodel.left, noder.right) && check(nodel.right, noder.left);
    }

}
